﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Vista.Privat
{
    public partial class Filmació : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Filmació
            ctrlFMFilmacio.NumOrdre = (String)HttpContext.Current.Session["NumOrdre"] ?? "-";
            if (HttpContext.Current.Session["DataEntrega"] != null)
                ctrlFMFilmacio.DataEntrega = (DateTime)HttpContext.Current.Session["DataEntrega"];
            else
                ctrlFMFilmacio.DataEntrega = DateTime.Today;
            ctrlFMFilmacio.HoraEntrega = (String)HttpContext.Current.Session["HoraEntrega"] ?? "-";
            ctrlFMFilmacio.Impressor = (String)HttpContext.Current.Session["Impressor"] ?? "-";
            ctrlFMFilmacio.Maquina = (String)HttpContext.Current.Session["Maquina"] ?? "-";
            ctrlFMFilmacio.ReferenciaClient = (String)HttpContext.Current.Session["ReferenciaClient"] ?? "-";
            ctrlFMFilmacio.IDTreball = (String)HttpContext.Current.Session["IDTreball"] ?? "-";
            ctrlFMFilmacio.PedidoClient = (String)HttpContext.Current.Session["PedidoClient"] ?? "-";

            //Màquina
            ctrlFMMaquines.NumOrdre = (String)HttpContext.Current.Session["NumOrdre"] ?? "-";
            if (HttpContext.Current.Session["DataEntrega"] != null)
                ctrlFMMaquines.DataEntrega = (DateTime)HttpContext.Current.Session["DataEntrega"];
            else
                ctrlFMMaquines.DataEntrega = DateTime.Today;
            ctrlFMMaquines.HoraEntrega = (String)HttpContext.Current.Session["HoraEntrega"] ?? "-";
            ctrlFMMaquines.Impressor = (String)HttpContext.Current.Session["Impressor"] ?? "-";
            ctrlFMMaquines.Maquina = (String)HttpContext.Current.Session["Maquina"] ?? "-";
            ctrlFMMaquines.ReferenciaClient = (String)HttpContext.Current.Session["ReferenciaClient"] ?? "-";
            ctrlFMMaquines.IDTreball = (String)HttpContext.Current.Session["IDTreball"] ?? "-";
            ctrlFMMaquines.PedidoClient = (String)HttpContext.Current.Session["PedidoClient"] ?? "-";

            
            /*string script = @"<script type='text/javascript'>
                            Printing();
                        </script>";

            ScriptManager.RegisterStartupScript(this, typeof(Page), "Printing", script, false);
             */ 
        }
    }
}